<div class="fui-page fui-page-current member-log-page">
    <div class="fui-header">
        <div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
        <div class="title">提现日志</div>
    </div>
    <div class="fui-content navbar">
        <div class="content-empty ng-hide" ng-show="pagedata.take_list.length<=0">
            <i class="fa fa-comment-o"></i><br>暂时没有任何记录!
        </div>
        <div class="fui-list-group container" ng-show="pagedata.take_list.length>0">
		<div class="fui-list goods-item ng-scope" ng-repeat="bv in pagedata.take_list">
            <div class="fui-list-inner">
                <div class="title ng-binding">提现金额:{{bv.money}}元</div>
                <div class="text ng-binding">{{bv.time}}</div>
            </div>
            <div class="fui-list-angle">
                <span class="fui-label fui-label-success">{{bv.statustitle}}</span>
            </div>
        </div>
		</div>
    </div>
</div>
<script>
if(!scope.pagedata.take_list){
	scope.pagedata.take_list=[];
}
scope.loading = true;  //状态标记
//滚动加载
var page = 1;
scope.getlist=function(first){
		if(first){
			var page = 1;
			scope.pagedata.take_list=[];
		}
		scope.pagedata.take_list=[];
		var params = {
					'plugin':'jy_jdpm',
					'action':'member.wallettake',
					'op':'main',
					'query':'page='+page,
					'callback':function(data){
							console.log('data');console.log(data);
							if(data.error !=1){
							 for (var i=0;i<data.take_list.length;i++){
									scope.pagedata.take_list.push(data.take_list[i]);
								}
								if(page >1){
									$("#getlist").animate({scrollTop:0},300);
								}
								page++;
								scope.loading = false;
								scope.$apply();
							}else{
								console.log('error');
							};
					}
		}
		scope.post_json(params);
}
		//首次加载
		scope.getlist(true);
		//滑到页面底部时加载下一页
		window.addEventListener('scroll', function () {
		   if(window.pageYOffset + window.innerHeight >= document.documentElement.scrollHeight){
				if(scope.loading){
					scope.getlist();
				}
		   }
		});
</script>